<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>Testing dojo.fx</title>
		<script type="text/javascript" src="../../dojo/dojo.js" djConfig="isDebug: true"></script>
		<script type="text/javascript" src="../base.js"></script>
		<script type="text/javascript">
			dojo.require("doh.runner");

			dojo.addOnLoad(function(){

				doh.register("t", 
					[
						function normalInt(t){
							var x = 10;
							t.is(x.pow(2), 100);
							t.is((9).sqrt(), 3);
						},
						
						function funky(t){
							var x = 5;
							var y = x.sqrt().pow(2).cos();
							t.t(true);
						},
						
						function chained(t){
							var x = 10;
							var y = x.pow(2).sqrt();
							t.is(x, y);
						},
						
						function floated(t){
							var x = 3.14;
							t.is(x.pow(2), Math.pow(x, 2));
						},
						
						function limit(t){

							var a = 12, b = -4, c = 4.3;
							var al = a.limit(2, 6.5),
								bl = b.limit(2, 6.5),
								cl = c.limit(2, 6.5);
								
							t.is(6.5, al);
							t.is(2, bl);
							t.is(4.3, cl);
							
							
						},
						
						function times(t){
							var x = 0;
							(10).times(function(i){
								x++;
							});
							t.is(10, x);
							
							var obj = {
							    c:0,
							    inc: function(){
							        this.c++;
							    }
							};
							
							(10).times(obj, "inc");
							t.is(obj.c, 10);
							
							var y = 0;
							(10).times(obj, function(inc){
							    this.c++;
							    y = inc;
							})
							t.is(obj.c, 20);
							t.is(9, y);
							
							var yy = 0;
							(3).times(obj, function(a, b, c, inc){
							    t.is(10, a);
							    t.is(20, b);
							    t.is(30, c);
							    t.is(yy++, inc);
							}, 10, 20, 30);
						}
					]
				);
				
				var autoTests = [];
				dojo.forEach([
					"abs", "acos", "asin", "atan", "atan2", "ceil", "cos", "exp", "floor", "log", 
					"max", "min", "pow", /* "random", "round", */ "sin", "sqrt", "tan"
				], function(meth){
					autoTests.push({
						name:"auto-" + meth,
						runTest: function(t){
							var x = 10;
							t.is(x[meth](), Math[meth](x));
						}
					});
				});
				doh.register("auto", autoTests);
				
				doh.run();
			});
		</script>
	<body>
		<div id="bar"></div>
	</body>
</html>
